package com.traveldream.entities;

import java.io.Serializable;

import javax.persistence.*;

import java.util.List;


/**
 * The persistent class for the product database table.
 * 
 */
@Entity
@NamedQuery(name="Product.findAll", query="SELECT p FROM Product p")
@NamedQueries({
	@NamedQuery(name="User.findAll", query="SELECT u FROM User u"),
	@NamedQuery(name="User.findByEmail",query="SELECT u FROM User u WHERE u.email LIKE :email")
})

public class Product implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;

	private float price;

	//bi-directional one-to-one association to Excursion
	@OneToOne(mappedBy="product")
	private Excursion excursion;

	//bi-directional one-to-one association to Flight
	@OneToOne(mappedBy="product")
	private Flight flight;

	//bi-directional one-to-one association to Hotel
	@OneToOne(mappedBy="product")
	private Hotel hotel;

	//bi-directional many-to-many association to Packet
	@ManyToMany(mappedBy="products")
	private List<Packet> packets;

	//bi-directional many-to-one association to Place
	@ManyToOne
	private Place place;

	public Product() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public float getPrice() {
		return this.price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public Excursion getExcursion() {
		return this.excursion;
	}

	public void setExcursion(Excursion excursion) {
		this.excursion = excursion;
	}

	public Flight getFlight() {
		return this.flight;
	}

	public void setFlight(Flight flight) {
		this.flight = flight;
	}

	public Hotel getHotel() {
		return this.hotel;
	}

	public void setHotel(Hotel hotel) {
		this.hotel = hotel;
	}

	public List<Packet> getPackets() {
		return this.packets;
	}

	public void setPackets(List<Packet> packets) {
		this.packets = packets;
	}

	public Place getPlace() {
		return this.place;
	}

	public void setPlace(Place place) {
		this.place = place;
	}

}